var amapFile = require('../../utils/amap-wx.js');//如：..­/..­/libs/amap-wx.js
Page({
    data: {

    },

    onLoad: function (options) {
        var that = this
        wx.getLocation({
            type: 'wgs84',
            success: function (res) {
                var latitude = res.latitude
                var longitude = res.longitude
                var speed = res.speed
                var accuracy = res.accuracy

                var markersData = {
                    latitude: latitude,//纬度
                    longitude: longitude,//经度
                    key: that.data.MapKey
                };
                var addArr = [];
                var myAmapFun = new amapFile.AMapWX({ key:"e62e6706033bcb067640317902ef53ad" });
                myAmapFun.getRegeo({
                    success: function (data) {
                        // console.log(data[0].regeocodeData.pois)
                        console.log(data)
                        var dataAll = data[0].regeocodeData.pois;
                        console.log(dataAll.length)
                        for (var i = 0; i < dataAll.length; i++) {
                            addArr.push({ "id": i, "address": dataAll[i] })
                        }
                        that.setData({ address: addArr })
                        console.log(that.data.address)
                        wx.hideLoading()
                    }

                });
            }
        })


    },



})